//
//  YSBookMarkModel.m
//  YSBookRead
//
//  Created by Kyson on 2018/11/6.
//  Copyright © 2018 YangShen. All rights reserved.
//

#import "YSBookMarkModel.h"

@implementation YSBookMarkModel

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:self.bookID forKey:@"bookID"];
    [aCoder encodeObject:self.chapterID forKey:@"chapterID"];
    [aCoder encodeObject:self.chapterName forKey:@"chapterName"];
    [aCoder encodeObject:self.content forKey:@"content"];
    [aCoder encodeObject:self.markTime forKey:@"markTime"];
    [aCoder encodeInteger:self.location forKey:@"location"];
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    if (self = [super init]) {
        self.bookID      = [aDecoder decodeObjectForKey:@"bookID"];
        self.chapterID   = [aDecoder decodeObjectForKey:@"chapterID"];
        self.chapterName = [aDecoder decodeObjectForKey:@"chapterName"];
        self.content     = [aDecoder decodeObjectForKey:@"content"];
        self.markTime    = [aDecoder decodeObjectForKey:@"markTime"];
        self.location    = [aDecoder decodeIntegerForKey:@"location"];
    }
    return self;
}

@end
